import { MockAdapter } from '../mock-adapter';
const mock = MockAdapter.getInstance();

import Mock from 'mockjs'

const datas: Array<any> = [
        {
        srfkey: 'SALE_ORDER__STATE',
        emptytext: '未定义',
        "codelisttype":"static",
        items: [
            {
                id: 'draft',
                label: '报价单',
                text: '报价单',
                value: 'draft',
                disabled: false,
            },
            {
                id: 'sent',
                label: '报价已发送',
                text: '报价已发送',
                value: 'sent',
                disabled: false,
            },
            {
                id: 'sale',
                label: '销售订单',
                text: '销售订单',
                value: 'sale',
                disabled: false,
            },
            {
                id: 'done',
                label: '已锁定',
                text: '已锁定',
                value: 'done',
                disabled: false,
            },
            {
                id: 'cancel',
                label: '已取消',
                text: '已取消',
                value: 'cancel',
                disabled: false,
            },
        ]
    },
    {
        srfkey: 'CRM_LEAD__PRIORITY',
        emptytext: '未定义',
        "codelisttype":"static",
        items: [
            {
                id: '0',
                label: '低',
                text: '低',
                value: '0',
                disabled: false,
            },
            {
                id: '1',
                label: '媒介',
                text: '媒介',
                value: '1',
                disabled: false,
            },
            {
                id: '2',
                label: '高',
                text: '高',
                value: '2',
                disabled: false,
            },
            {
                id: '3',
                label: '非常高',
                text: '非常高',
                value: '3',
                disabled: false,
            },
        ]
    },
    {
        srfkey: 'CodeList',
        emptytext: '未定义',
        "codelisttype":"static",
        items: [
            {
                id: 'New',
                label: '新增',
                text: '新增',
                value: 'New',
                disabled: false,
            },
            {
                id: 'Qualified',
                label: '验证',
                text: '验证',
                value: 'Qualified',
                disabled: false,
            },
            {
                id: 'Proposition',
                label: '建议',
                text: '建议',
                value: 'Proposition',
                disabled: false,
            },
            {
                id: 'Won',
                label: '赢得',
                text: '赢得',
                value: 'Won',
                disabled: false,
            },
        ]
    }
];

// 获取全部数组
mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
    let status = MockAdapter.mockStatus(config);
    return [status, datas, config.headers, config];
});
